package com.atguigu.lease.common.springmvc;

import com.atguigu.lease.common.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * ClassName: GlobalExceptionHandlers
 * Package: com.atguigu.lease.common.springmvc
 *
 * @Create 2025/10/30 17:15
 * @Author 阿瓒
 * @Version 1.0
 * Description:
 */
@RestControllerAdvice
public class GlobalExceptionHandlers {

    //定义各种异常处理方法
    @ExceptionHandler(Exception.class)
    public Result exception(Exception e){
        e.printStackTrace();  //打印异常信息
        return Result.fail();
    }
}
